#include "ShiftExpr.h"
#include "AdditiveExpr.h"
#include <iostream>
#include <string>
#include <assert.h>

ShiftExpr::~ShiftExpr(void)
{
	switch(m_iType)
	{
	case single_expr:
		delete m_pSingleExpr;
		break;
	case left_shift_expr:
	case right_shift_expr:
		delete m_pShiftExpr;
		delete m_pAddExpr;
		break;
	default:
		std::cout<<"ShifExpr::~ShiftExpr(), Unknown type!\n"<<std::endl;
		exit(1);
	}
}

void ShiftExpr::codeGen()
{
	COUT
	switch(m_iType)
	{
	case single_expr:
		m_pSingleExpr->codeGen();
		break;
	case left_shift_expr:
	case right_shift_expr:
		m_pShiftExpr->codeGen();
		m_pAddExpr->codeGen();
		break;
	default:
		std::cout<<"ShifExpr::codeGen(), Unknown type!\n"<<std::endl;
		exit(1);
	}
}